package day240527.work;

import day240514.p1.Teacher;
import day240514.p1.TeacherFirstLetterComparator;

import java.sql.Connection;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;

public class CollectionCommon4 {
    public static void main(String[] args) {
        List<Teacher> teachers=new ArrayList<>();
        teachers.add(new Teacher("X老师",'X',19));
        teachers.add(new Teacher("A老师",'A',45));
        teachers.add(new Teacher("C老师",'C',21));
        teachers.add(new Teacher("S老师",'S',46));
        teachers.add(new Teacher("L老师",'L',33));
        System.out.println(teachers);
        teachers.sort(new TeacherFirstLetterComparator());//首字母排序
        System.out.println(teachers);
        Collections.shuffle(teachers);//洗牌：乱序
        System.out.println(teachers);



    }
}
